<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<AvansRS.Domain.Person>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Model.FirstName + " " + Model.SurName %> </h2>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm("Edit", "User", new {ID = Model.ID})) {%>    
        <fieldset>
            <legend>Persoonsgegevens</legend>       
            
            <p>
                <label for="FirstName">Voornaam:</label>
                <%= Html.TextBox("FirstName", Model.FirstName) %>
                <%= Html.ValidationMessage("FirstName", "*") %>
            </p>
            <p>
                <label for="SurName">Achternaam:</label>
                <%= Html.TextBox("SurName", Model.SurName)%>
                <%= Html.ValidationMessage("SurName", "*") %>
            </p>            
            <p>
                <label for="Number">Number:</label>
                <%= Html.TextBox("Number", Model.Number)%>
                <%= Html.ValidationMessage("Number", "*") %>
            </p>         
            <p>
                <label for="Academy">Academy:</label>                                
                <%= Html.DropDownList("academyID", (IEnumerable<SelectListItem>)ViewData["academyList"])%>
            </p>
            <p>
                <label for="Study">Study:</label>                                
                <%= Html.DropDownList("studyID", (IEnumerable<SelectListItem>)ViewData["studyList"])%>
            </p>  
        </fieldset>        
        <fieldset>
            <legend>Accountgegevens</legend>            
            <p>
                <label for="UserName">Gebruikersnaam:</label>
                <%= Html.TextBox("UserName", Model.Account.UserName)%>
                <%= Html.ValidationMessage("UserName", "*")%>
            </p>                  
            <p>
                <label for="Email">Email:</label>
                <%= Html.TextBox("Email", Model.Account.Email)%>
                <%= Html.ValidationMessage("Email", "*") %>
            </p>     
            <p>
                <label for="InitialPassword">Nieuw Wachtwoord:</label>
                <%= Html.Password("InitialPassword")%>
                <%= Html.ValidationMessage("InitialPassword", "*")%>
            </p>
            <p>
                <label for="ConfirmPassword">Bevestig Wachtwoord:</label>
                <%= Html.Password("ConfirmPassword")%>
                <%= Html.ValidationMessage("ConfirmPassword", "*")%>
            </p>
        </fieldset>        
        
        <p>
            <input type="submit" value="Bewaar gebruiker" />
        </p>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index", new { type = Session["type"] })%>
    </div>

</asp:Content>

